using UnityEngine;
using UnityEngine.Audio;

public class TimeMaster : MonoBehaviour
{
	private float initialFixedTime;

	[Tooltip("Master audio mixer")]
	public AudioMixer masterMixer;

	public bool destroyOnLoad;

	private void Awake()
	{
		initialFixedTime = Time.fixedDeltaTime;
		if (!destroyOnLoad)
		{
			Object.DontDestroyOnLoad(base.gameObject);
		}
	}

	private void Update()
	{
		if ((bool)masterMixer)
		{
			masterMixer.SetFloat("MasterPitch", Time.timeScale);
		}
	}

	private void FixedUpdate()
	{
		Time.fixedDeltaTime = Time.timeScale * initialFixedTime;
	}
}
